<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>测试视频推流服务</title>
    <script type="text/javascript" src="../js/include-web.js"></script>
    <script type="text/javascript" src="../../dist/ol/include-ol.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%; position: absolute;top: 0;">
<div id="map" style="width: 100%;height:100%"></div>
<script type="text/javascript">
    var url = (window.isLocal ? window.server : "https://iserver.supermap.io")+"/iserver/services/data-world/rest/data";
    queryVideoByBounds();
    queryVideoBySQL();
    queryVideoByTime();

    function queryVideoByBounds() {
        //添加查询区域
        var polygon = new ol.geom.Polygon([[[-20, 20], [-20, -20], [20, -20], [20, 20], [-20, 20]]]);
        var boundsParam = new ol.supermap.GetFeaturesByBoundsParameters({
            datasetNames: ["World:Capitals"],
            bounds: polygon.getExtent()
        });
        new ol.supermap.FeatureService(url).getFeaturesByBounds(boundsParam).then(function (serviceResult) {
          console.log('serviceResult.result.features', serviceResult.result.features);
        });
    }

    function queryVideoBySQL() {
      var sqlParam = new ol.supermap.GetFeaturesBySQLParameters({
            queryParameter: {
                name: "Countries@World",
                attributeFilter: "SMID = 234"
            },
            datasetNames: ["World:Countries"]
        });
        new ol.supermap.FeatureService(url).getFeaturesBySQL(sqlParam).then(function (serviceResult) {
          console.log('serviceResult.result.features', serviceResult.result.features);
        });
    }

    function queryVideoByTime() {
      var sqlParam = new ol.supermap.GetFeaturesBySQLParameters({
            queryParameter: {
                name: "Countries@World",
                attributeFilter: "SMID = 234"
            },
            datasetNames: ["World:Countries"]
        });
        new ol.supermap.FeatureService(url).getFeaturesBySQL(sqlParam).then(function (serviceResult) {
          console.log('serviceResult.result.features', serviceResult.result.features);
        });
    }
</script>
</body>
</html>